import {getToken} from "@/utils/index.js"
import {Navigate } from "react-router-dom"
const AuthRoute=({children})=>{
    const isToken=getToken()
    //判断是否存在token，执行不同操作
    if(isToken){//存在toen跳转对应页面，否则跳转到登录页面
        return <>{children}</>
    }else{
        return <Navigate to="/login" replace></Navigate>
    }
}

export default AuthRoute